<%@ page language="java" import="java.util.*,java.net.URLDecoder" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<title></title>

	<link rel="stylesheet" href="<%=path %>/skin/default/css/editor.css" type="text/css" />
	<link rel="stylesheet" href="<%=path %>/skin/default/css/button.css" type="text/css" />
	<link rel="stylesheet" href="<%=path %>/scripts/dialog/default/ymPrompt.css" type="text/css" />

	<script type="text/javascript" src="<%=path %>/scripts/jquery/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="<%=path %>/scripts/jquery/jquery.json-2.2.min.js"></script>
	<script type="text/javascript" src="<%=path %>/scripts/dialog/ymPrompt.js"></script>
	<script type="text/javascript" src="<%=path %>/scripts/validator.js"></script>
	<script type="text/javascript" src="<%=path %>/scripts/utils.js"></script>
	<script type="text/javascript">
		$(function(){
			$.ajaxSetup({
				type : 'POST',
				dataType : 'json',
				contentType : 'application/json',
				cache : false,
				async : false
			});
			checkForm("form");
			repeatPwd();
			$("#btnUpdatePwd").click(function(){
				if(checkAll("form") && checkPwd()){
					var jsonData = $.toJSON($("#form").serializeObject());
					//alert(jsonData);
					$.post("<%=path %>/UpdatePwd.do",jsonData,function(rs){
						if(rs == "success"){
							ymPrompt.alert({title:"温馨提示",message:"密码修改成功，请牢记密码",width:320,heigth:80,handler:function(tp){
								if(tp=='ok' || tp=='close'){
									window.parent.ymPrompt.doHandler('',true);
								}
							}});
						}
					});
				}
			});
			$("#btnClose").click(function(){
				window.parent.ymPrompt.doHandler('',true);
			});
		});
	</script>
</head>
<body>
<div id="container">
	<div class="bottomBar">
		<div class="fr" style="margin-right: 10px;">
			<input type="button" id="btnUpdatePwd" name="btnUpdatePwd" class="btn btn82 btn_save_bottom" value="修 改" />
			<input type="button" id="btnClose" name="btnClose" class="btn btn82 btn_close" value="关 闭" />
		</div>
	</div>
	<input type="hidden" id="basePath" name="basePath" value="<%=path %>" />
	<form action="" id="form" method="post">
		<input type="hidden" id="id" name="id" value="${sessionScope.UserSession.id }" />
		<table cellpadding="0" cellspacing="0" border="0" align="center" class="form_table">
			<tr>
				<td class="td_right">原始密码：</td>
				<td>
					<input type="password" id="pwd" name="pwd" value="" class="input_text CheckRight" require="OldPwd"/>
				</td>
			</tr>
			<tr>
				<td class="td_right">新密码：</td>
				<td style="padding-top: 2px;">
					<input type="password" id="newPwd" name="newPwd" value="" class="input_text" require="NewPwd" onKeyUp="pwStrength(this.value)" onBlur="pwStrength(this.value)"/>
					<table class="pwd_table">
						<tr>
							<td id="strength_L" class="td_pwd">弱<td>
							<td id="strength_M" class="td_pwd">中<td>
							<td id="strength_H" class="td_pwd">强<td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="td_right">重复新密码：</td>
				<td>
					<input type="password" id="rePwd" name="rePwd" value="" class="input_text" />
					<span id="repwd_error" style="color: #ff9200;"></span>
				</td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>